<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定时任务详细</title>
    <script src="../../../resources/app/all.js" type="text/javascript"></script>
    <style type="text/css">
        a:link {
            text-decoration: none;
        }

        a:visited {
            text-decoration: none;
        }

        a:hover {
            text-decoration: none;
        }

        a:active {
            text-decoration: none;
        }

        #tag_ids2 a {
            padding: 2px 5px;
            background: #5FB878;
            border-radius: 2px;
            color: #fff;
            display: block;
            line-height: 20px;
            height: 24px;
            margin: 2px 5px 2px 0;
            float: left;
        }

    </style>
</head>
<body class="easyui-layout" data-options="fit:true">

<div data-options="region:'center'" style="padding: 5px;">
    <form class="layui-form layui-form-pane" action="" id="form" lay-filter="example">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">任务ID</label>
                <div class="layui-input-block">
                    <input type="text" name="jobId" lay-verify="required" autocomplete="off" placeholder="请输入任务名称"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">任务名称</label>
                <div class="layui-input-block">
                    <input type="text" name="jobName" lay-verify="required" autocomplete="off" placeholder="请输入任务名称"
                           class="layui-input">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">任务组</label>
                <div class="layui-input-block">
                    <select name="jobGroup">
                        <option value="DEFAULT" selected>默认</option>
                        <option value="SYSTEM">系统</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">下次时间</label>
                <div class="layui-input-block">
                    <input type="text" name="nextExecution" lay-verify="required" autocomplete="off" placeholder="请输入任务名称"
                           class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">调用目标</label>
            <div class="layui-input-block">
                <input type="text" name="invokeTarget" lay-verify="required" autocomplete="off"
                       placeholder="请输入调用目标"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">cron执行表达式</label>
            <div class="layui-input-block">
                <input type="text" name="cronExpression" lay-verify="required" autocomplete="off"
                       placeholder="请输入cron执行表达式"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否并发</label>
            <div class="layui-input-block">
                <input type="radio" name="concurrent" value="0" title="允许">
                <input type="radio" name="concurrent" value="1" title="禁止" checked="">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">错误策略</label>
            <div class="layui-input-block">
                <input type="radio" name="misfirePolicy" value="1" title="立即执行" checked="">
                <input type="radio" name="misfirePolicy" value="2" title="执行一次">
                <input type="radio" name="misfirePolicy" value="3" title="放弃执行">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="radio" name="status" value="0" title="启用" >
                <input type="radio" name="status" value="1" title="暂停" checked="">
            </div>
        </div>

    </form>
</div>
<div data-options="region:'south',border:false">
    <div class="dialog-button">
        <button id="cancel" class="layui-btn layui-btn-primary">取消</button>
    </div>
</div>

<script>
    layui.use(['form'], function () {
        var form = layui.form
            , layer = layui.layer;
        let parData = ToolUtil.OpenData();
        let data = parData.data;
        data.nextExecution=formatDateTime(new Date(data.nextExecution));
        form.val('example', JSON.parse(JSON.stringify(data)));

        layui.$('#cancel').on('click', function () {
            clear();
        });

        function clear() {
            let index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
            layer.close(index);
        }


    });
</script>
</body>
</html>